A USB charger includes a USB adaptor and a USB cable, and the USB adaptor and the USB cable both include a USB connector. When an electronic device is being charged, a first terminal of the USB cable is connected to the USB adaptor, and a second terminal of the USB cable is connected to the electronic device.